<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的车辆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="../../plugins/mui/mui.min.css">
    <script src="../../js/statistics.js"></script>
    <style>
        /*title的样式覆盖*/
        .mui-bar{
            background-color:#2a2c33;
            top:0;
        }
        .mui-bar>a{
            color:#fff;
        }
        .mui-title{
            color:#fff;
        }
    </style>
</head>
<body>
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">车辆信息</h1>
    </header>
    <div class="mui-content">

    </div>
    <script type="text/javascript" src='../../plugins/jquery/jquery-3.1.0.min.js'></script>
    <script src="../../plugins/mui/mui.min.js"></script>
    <script src="../../js/getApiToken.js"></script>
    <script src="../../js/md5.js"></script>
    <script type="text/javascript">
        mui.plusReady(function() {
            var href={
                noAdd:'car-2.html',
                added:'car-4.html'
            };
            var wait = plus.nativeUI.showWaiting('正在加载中...');
            main = plus.webview.currentWebview();
            myAjax('car/car/index', 'post', {
                        'user_id': plus.storage.getItem('cg_user_id'),
                        'user_token': plus.storage.getItem('cg_user_token')
                   }, function(data) {
                        wait.close();
//                        if(!data.success){
//                            wait.close();
//                            mui.toast("加载失败，请重新加载！")
//                            return ;//发生错误 就直接退出
//                        }else{
                            var jumpTo;
                console.log(JSON.stringify(data));
                            if(data.status==-1){
                                jumpTo=href.noAdd
                            }else{
                                jumpTo=href.added
                            }
                            var content = plus.webview.create(jumpTo,'content',{
                                top: '45px',
                                bottom: '0',
                                bounce: 'vertical',
                                background:'transparent'
                            });
                            main.append(content);
                            content.addEventListener('loaded',function(){
                            });
//                        }
                    }
            );


        })
    </script>
</body>
</html>